<template>

    <el-form ref="form1" :model="form" label-width="120px" size="mini">


      <el-form-item>
       <!-- <el-col :span="8">
          <el-button type="primary" plain >暂存</el-button>
        </el-col> -->
        <el-col :span="12">
          <el-button type="primary" plain @click="submit">提交</el-button>
        </el-col>
        <el-col :span="12">
          <el-button type="primary" plain >清空所有</el-button>
        </el-col>

      </el-form-item>

      <el-form-item>

        <el-col :span="11">
          姓名 <el-input v-model="form.name" disabled></el-input>
        </el-col>
        <el-col class="line" :span="2">&nbsp;</el-col>
        <el-col :span="11">
          年龄 <el-input v-model="form.age" disabled></el-input>
        </el-col>
      </el-form-item>


    
     <el-form-item label="治疗方案">
        <el-input type="textarea" v-model="form.suit"></el-input>
      </el-form-item>
     

    </el-form>

</template>

<script>
  export default {
    name: 'PaperHome',
    props: [
      'register'
    ],
    components: {

    },
    data() {

      return {
        options: [],
        form: {
            id: 0,
            name: '',
            age: 0,
            suit: ''
           
        }

      }

    },
    methods: {
      submit() {
        //当通过验证
        if(this.register){
            //更新页面上的值到 持久
            this.axios.get('/doctor?type=finish', response => {
				this.$message.success("诊疗完成")
               this.$emit('update')
            },this.form)
        }else{
          this.$message.error("请选择患者")
        }
      }
    },
    created() {

    },
    watch:{
      register(val1,val2){
        //console.log(val1,val2);
         this.form.id			=  val1.id
         this.form.name			=  val1.name
         this.form.age			=  val1.age
        
      }
    }
  }
</script>

<style>
</style>
